package chapter7.No7_1_线程的状态.d验证WAITING;

/**
 * !验证WAITING
 *
 * @author liujian
 * @version 2016/12/8 0008
 */
public class Main {

    static class MyThread extends Thread {
        @Override
        public synchronized void run() {
            System.out.println("进入RUN" + System.currentTimeMillis());
            try {
                this.wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("退出RUN" + System.currentTimeMillis());
        }
    }

    public static void main(String[] args) throws InterruptedException {
        MyThread a = new MyThread();
        a.start();
        Thread.sleep(50);
        System.out.println("线程的状态：" + a.getState());
    }
}
